load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "bootstrap",
    srcs = [
        "bootstrap.go",
        "cli.go",
        "config.go",
        "daemon.go",
        "flag.go",
        "grpc.go",
        "logger.go",
        "oss.go",
        "redis.go",
        "registry.go",
        "rest.go",
        "service_info.go",
        "tracer.go",
    ],
    importpath = "kratos-cms/pkg/bootstrap",
    visibility = ["//visibility:public"],
    deps = [
        "//gen/api/go/common/conf",
        "@com_github_go_chassis_sc_client//:sc-client",
        "@com_github_go_kratos_kratos_contrib_config_apollo_v2//:apollo",
        "@com_github_go_kratos_kratos_contrib_config_consul_v2//:consul",
        "@com_github_go_kratos_kratos_contrib_config_etcd_v2//:etcd",
        "@com_github_go_kratos_kratos_contrib_config_kubernetes_v2//:kubernetes",
        "@com_github_go_kratos_kratos_contrib_config_nacos_v2//:nacos",
        "@com_github_go_kratos_kratos_contrib_config_polaris_v2//:polaris",
        "@com_github_go_kratos_kratos_contrib_log_aliyun_v2//:aliyun",
        "@com_github_go_kratos_kratos_contrib_log_fluent_v2//:fluent",
        "@com_github_go_kratos_kratos_contrib_log_logrus_v2//:logrus",
        "@com_github_go_kratos_kratos_contrib_log_tencent_v2//:tencent",
        "@com_github_go_kratos_kratos_contrib_log_zap_v2//:zap",
        "@com_github_go_kratos_kratos_contrib_registry_consul_v2//:consul",
        "@com_github_go_kratos_kratos_contrib_registry_etcd_v2//:etcd",
        "@com_github_go_kratos_kratos_contrib_registry_eureka_v2//:eureka",
        "@com_github_go_kratos_kratos_contrib_registry_kubernetes_v2//:kubernetes",
        "@com_github_go_kratos_kratos_contrib_registry_nacos_v2//:nacos",
        "@com_github_go_kratos_kratos_contrib_registry_polaris_v2//:polaris",
        "@com_github_go_kratos_kratos_contrib_registry_servicecomb_v2//:servicecomb",
        "@com_github_go_kratos_kratos_contrib_registry_zookeeper_v2//:zookeeper",
        "@com_github_go_kratos_kratos_v2//config",
        "@com_github_go_kratos_kratos_v2//config/file",
        "@com_github_go_kratos_kratos_v2//log",
        "@com_github_go_kratos_kratos_v2//middleware",
        "@com_github_go_kratos_kratos_v2//middleware/recovery",
        "@com_github_go_kratos_kratos_v2//middleware/tracing",
        "@com_github_go_kratos_kratos_v2//registry",
        "@com_github_go_kratos_kratos_v2//transport/grpc",
        "@com_github_go_kratos_kratos_v2//transport/http",
        "@com_github_go_redis_redis_extra_redisotel_v8//:redisotel",
        "@com_github_go_redis_redis_v8//:redis",
        "@com_github_go_zookeeper_zk//:zk",
        "@com_github_google_subcommands//:subcommands",
        "@com_github_gorilla_handlers//:handlers",
        "@com_github_hashicorp_consul_api//:api",
        "@com_github_minio_minio_go_v7//:minio-go",
        "@com_github_minio_minio_go_v7//pkg/credentials",
        "@com_github_nacos_group_nacos_sdk_go//clients",
        "@com_github_nacos_group_nacos_sdk_go//common/constant",
        "@com_github_nacos_group_nacos_sdk_go//vo",
        "@com_github_olekukonko_tablewriter//:tablewriter",
        "@com_github_polarismesh_polaris_go//:polaris-go",
        "@com_github_polarismesh_polaris_go//api",
        "@com_github_polarismesh_polaris_go//pkg/model",
        "@com_github_sirupsen_logrus//:logrus",
        "@com_github_spf13_cobra//:cobra",
        "@in_gopkg_natefinch_lumberjack_v2//:lumberjack_v2",
        "@io_etcd_go_etcd_client_v3//:client",
        "@io_k8s_client_go//kubernetes",
        "@io_k8s_client_go//rest",
        "@io_k8s_client_go//tools/clientcmd",
        "@io_k8s_client_go//util/homedir",
        "@io_opentelemetry_go_otel//:otel",
        "@io_opentelemetry_go_otel//attribute",
        "@io_opentelemetry_go_otel//semconv/v1.4.0:v1_4_0",
        "@io_opentelemetry_go_otel_exporters_jaeger//:jaeger",
        "@io_opentelemetry_go_otel_exporters_zipkin//:zipkin",
        "@io_opentelemetry_go_otel_sdk//resource",
        "@io_opentelemetry_go_otel_sdk//trace",
        "@org_golang_google_grpc//:go_default_library",
        "@org_golang_google_protobuf//types/known/durationpb",
        "@org_golang_x_tools//go/ast/astutil",
        "@org_golang_x_tools//go/packages",
        "@org_uber_go_zap//:zap",
        "@org_uber_go_zap//zapcore",
    ],
)

go_test(
    name = "bootstrap_test",
    srcs = ["registry_test.go"],
    embed = [":bootstrap"],
    deps = [
        "//gen/api/go/common/conf",
        "@com_github_stretchr_testify//assert",
    ],
)
